package com.lyd.server;

import com.lyd.mapper.UserMapper;
import com.lyd.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServer {
    @Autowired
    UserMapper userMapper;

//    @Bean
//    public UserMapper userMapperImp(){
//        return new UserMapperImp();
//    }


    public void saveOrUpdateUser(User user) {
        userMapper.saveOrUpdateUser(user);
    }


    public void deteleUser(User user) {
        userMapper.deteleUser(user);
    }


    public User getUserById(Long id) {
        return userMapper.getUserById(id);
    }


    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }
}
